﻿//        Another Demo from Andy L. & MissedMemo.com
// Borrow whatever code seems useful - just don't try to hold
// me responsible for any ill effects. My demos sometimes use
// licensed images which CANNOT legally be copied and reused.

using System.Collections.ObjectModel;

using MissedMemo.MeatAndCheeseDisc.OrderEntryDataAccess;


namespace MissedMemo.MeatAndCheeseDisc.OrderEntryService.OrderProcessing
{
    // EXTEND local service data proxy with Client-specific features...
    public partial class Pizza
    {
        public bool IsDone { get; set; }

        public Pizza()
        {
            Options = new ObservableCollection<string>();

            // Default values (check menu)
            Type = "Combination";
            Size = "Medium";
        }


        public override OrderItem Clone()
        {
            // Allow base class to carry out any initialization...
            Pizza copy = (Pizza)base.Clone();

            // Then, add any LOCAL field values...

            // Then, make deep copies of any reference fields...
            copy.Options = new ObservableCollection<string>();
            foreach( string strOption in Options )
                copy.Options.Add( strOption );

            return copy;
        }


        public override void UpdatePrice()
        {
            base.UpdatePrice();

            foreach( string strOption in Options )
                Price += LookupMenuItem.GetToppingOrOptionPrice( strOption, Size );
        }
    }
}
